#DES = defined
MERGE = --nomerge

define INCLUDE_template
INCLUDES += $$(join -I../lib, $(1))
endef

define LIB_template
INCLUDES += $$(join -I../lib, $(1))
LIBS     += $$(join -L../lib, $(1)) $$(join -l, $(1)) -Wl,-rpath,$$(join `pwd`/../lib, $(1))
endef

ifdef DES
USELIBS  := scdes $(USELIBS)
else
USEINCLUDES := sclinux $(USEINCLUDES)
endif

SDF = $(SC_TOP)/share/sdf

LIBS += -lpthread
CFLAGS += -D_REENTRANT -O2 -fno-strict-aliasing
#CFLAGS += -D_REENTRANT -O0 -g
PREFIX=$(SC_TOP)/src/sc

$(foreach inc, $(USEINCLUDES), $(eval $(call INCLUDE_template, $(inc))))
$(foreach lib, $(USELIBS), $(eval $(call LIB_template, $(lib))))
